<?php


namespace App\Http\Controllers\admin\validate;


use Illuminate\Support\Facades\Validator;

class Statistics
{
    public static function querySumSn($param){
        $rules = [
            'userId'=>'required|numeric',
        ];
        $msg = [
            'userId.required'=>'用户编号为空',
            'userId.numeric'=>'用户编号格式不对',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function appUploadStatistics($param){
        $rules = [
            'userId'=>'required|numeric',
        ];
        $msg = [
            'userId.required'=>'用户编号为空',
            'userId.numeric'=>'用户编号格式不对',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function queryAppOnlineTime($param){
        $rules = [
            'userId'=>'required|numeric',
        ];
        $msg = [
            'userId.required'=>'用户编号为空',
            'userId.numeric'=>'用户编号格式不对',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function statisticsFlow($param){
        $rules = [
            'userId'=>'required|numeric',
        ];
        $msg = [
            'userId.required'=>'用户编号为空',
            'userId.numeric'=>'用户编号格式不对',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function queryStatistics($param){
        $rules = [
            'userId'=>'required|numeric',
            'type'=>'required|numeric',
            'startSize'=>'required|numeric',
            'pageSize'=>'required|numeric',
        ];
        $msg = [
            'userId.required'=>'用户编号为空',
            'type.required'=>'类型为空',
            'startSize.required'=>'当前页为空',
            'pageSize.required'=>'页面显示数为空',
            'userId.numeric'=>'用户编号格式不对',
            'type.numeric'=>'类型格式不对',
            'startSize.numeric'=>'当前页格式不对',
            'pageSize.numeric'=>'页面显示数格式不对',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function queryIdStatistics($param){
        $rules = [
            'id'=>'required|numeric',
        ];
        $msg = [
            'id.required'=>'编号为空',
            'id.numeric'=>'编号格式不对',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }

    public static function editStatistics($param){
        $rules = [
            'id'=>'required|numeric',
            'monthFlow'=>'required|numeric',
        ];
        $msg = [
            'id.required'=>'编号为空',
            'monthFlow.required'=>'当月限制流量为空',
            'id.numeric'=>'编号格式不对',
            'monthFlow.numeric'=>'当月限制流量格式不对',
        ];
        return Validator::make($param,$rules,$msg)->errors()->all();
    }
}